package com.hbnu.service;

import com.hbnu.dao.UserDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;


@Service
@Transactional  //事务注解
public class UserService {
    @Resource(name = "userDao")

   private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    
    public void addUser() {
        //System.out.println("add user by userService......");
        //userDao.addUser;
    }

    public void account(String sendName,String receiveName,Double money){
        userDao.lessMoney(sendName,money);
        userDao.lessMoney(receiveName,money);
    }
}
